import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '../views/myLayout.vue'
import Article from '@/views/MyArticle.vue'
import Like from '@/views/MyLike.vue'
import Collect from '@/views/MyCollect.vue'
import User from '@/views/MyUser.vue'
import Login from '@/views/MyLogin.vue'
import Resgister from '@/views/MyResgister.vue'
import Detail from '@/views/MyDetail.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/article',
    children: [
      { path: 'article', component: Article },
      { path: 'like', component: Like },
      { path: 'collect', component: Collect },
      { path: 'user', component: User }

    ]
  },
  { path: '/login', component: Login },
  { path: '/register', component: Resgister },
  { path: '/article', component: Detail }
]

const router = new VueRouter({
  // routes:routes
  routes
})

export default router
